import {ADDPERSON} from '../const.js'

const initState=[
	{
		id:'001',
		name:'cowen'
	},
	{
		id:'002',
		name:'min'
	}
]

function Reducer(preState=initState,action){
	const newState=Object.assign([],preState);
	const {type,data}=action;
	switch (type) {
		case ADDPERSON:
			newState.unshift(data)
			break;
		default:
			break;
	}
	return newState
}

export default Reducer